<?php $db = new Mypdo(); ?><?php

if (!empty($_SESSION['login'])&&!empty($_SESSION['email'])){

$propriManager = new ProprietaireManager($db);
$propri = $propriManager->getList();
?>
<h1>Liste des propriétaires</h1>
<table class="tableau" >
    <tr>
        <th>Genre</th>
        <th>Nom</th>
        <th>Prenom</th>
        <th>Email</th>
        <th>Détail</th>
    </tr>
    <?php foreach ($propri as $valeur) {  ?>

        <tr>
            <td><?php echo $valeur->getGenrePropri(); ?></td>
            <td><?php echo $valeur->getNomPropri(); ?></td>
            <td><?php echo $valeur->getPrenomPropri(); ?></td>
            <td><?php echo $valeur->getEmailPropri(); ?></td>
            <td><input id="detail" name="detail" type="button" onclick="document.location.href='index.php?page=111&id=<?php echo $valeur->getIdPropri(); ?>'" /></td>
        </tr>

    <?php } ?>
</table>

    <input id="add" name="add" type="button" onclick="document.location.href='index.php?page=101'" value="Ajouter Propriétaire" />

<?php }else{
    header('Location: index.php');
}